Learn R Programming

Rfast (version 1.2)

The sums of the columns and rows : The sums of the columns and rows .

Description

The sums of the columns and rows .

Usage

colsums(x)
rowsums(x)

Arguments

x
A numerical matrix with data.

Value

Returns a row vector with column sums or a column vector with the row sums.

See Also

colsums

Examples

Run this code
x <- matrix(rpois(1000 * 1000,10),ncol = 1000)
x1 <- colsums(x)
x2 <- colSums(x)
x1 == x2

x1 <- rowsums(x)
x2 <- rowSums(x)
x1 == x2

Run the code above in your browser using DataLab